

#ifndef _TF_ELEMENT_
#define _TF_ELEMENT_
#include "tf_Geom_Object.h"
#include "tf_Geom_Object_Manager.h"


class dllDeclspec TfElement : public TfGeomObject
{
protected:
	TfElement();
public:
	~TfElement();

	
	TfElement& operator=(TfElement& rhs);
	int  GetType();
	int  GetNodes(int nodeIds[8]);
	void GetNodes(IntVector& nodeIds);
	int  GetPartId();
	int  GetSurfId();
	friend class TfElementManager;

private:
	int m_type;
	int m_surfId;
	int m_num;
	int m_nodeIds[8];
	
};

class dllDeclspec TfElementManager : public TfGeomObjectManager
{
protected:
	TfElementManager();
public:
	~TfElementManager();

public:
	// Shell Element
	int  CreateElement(int nodeIds[],int num,int partId);
	// Solid Element
	int  CreateSolidElenent(int nodeIds[],int num, int partId);

	void DeleteElement(int id);
	void DeleteElements(IntVector& ids);

	int  GetElementNodes(int id,int nodeIds[8]);
	void GetElementNodes(int id,IntVector& nodeIds);

	int  GetElementPartId(int id);
	void GetPartElements(int pid,IntVector& elems);
	int  GetPartElements(int pid,int* elems );
	
	void AddToDataBase(int idx, TfGeomObject* obj);
	void AdditionSpace();

	static TfElementManager* Instance();

};

#define TfEmMng (*TfElementManager::Instance())

#endif

